<h1>Map View Specific Sample Page</h1>
<?php
//
// ext is your protected.extensions folder
// gmaps means the subfolder name under your protected.extensions folder
//
//echo   "<pre>";
//print_r($projects);
//echo   "<pre>";
Yii::import('ext.egmap.*');
$gMap = new EGMap();
$gMap->zoom = 6;
$mapTypeControlOptions = array(
  'position'=> EGMapControlPosition::LEFT_BOTTOM,
  'style'=>EGMap::MAPTYPECONTROL_STYLE_DROPDOWN_MENU
);
 
$gMap->mapTypeControlOptions= $mapTypeControlOptions;
 
//$gMap->setCenter(39.721089311812094, 2.91165944519042);
//12.46876,122.67334
$gMap->setCenter(12.46876,122.67334);

// Create GMapInfoWindows
$info_window_b = new EGMapInfoWindow('Hey! I am a marker with label!');
//$icon = new EGMapMarkerImage("https://google-maps-icons.googlecode.com/files/housesolarpanel.png");
//Yii::app()->request->baseUrl
$icon = new EGMapMarkerImage(Yii::app()->request->baseUrl."/images/home.png");
$icon->setSize(32, 37);
$icon->setAnchor(16, 16.5);
$icon->setOrigin(0, 0);
foreach($projects as $value){
	$arlatlong = explode(', ',$value->latlng);
	//print_r($arlatlong);
	//exit;
	$info_window_a = new EGMapInfoWindow('<div>This is a property!</div>');
	$marker = new EGMapMarker($arlatlong[0], $arlatlong[1], array('title' => 'Somewhere in Manila','icon'=>$icon));
	$marker->addHtmlInfoWindow($info_window_a);
	$gMap->addMarker($marker);
}

//$icon = new EGMapMarkerImage("http://google-maps-icons.googlecode.com/files/gazstation.png");
/*href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css"*/


 
// Create marker
/*
$marker = new EGMapMarker(39.721089311812094, 2.91165944519042, array('title' => 'Marker With Custom Image','icon'=>$icon));
$marker->addHtmlInfoWindow($info_window_a);
$gMap->addMarker($marker);
*/



// Create marker with label
//$marker = new EGMapMarkerWithLabel(13.987376,122.651367, array('title' => 'Marker With Label'));
 
/*$label_options = array(
  'backgroundColor'=>'yellow',
  'opacity'=>'0.75',
  'width'=>'100px',
  'color'=>'blue'
);
 
/*
// Two ways of setting options
// ONE WAY:
$marker_options = array(
  'labelContent'=>'$9393K',
  'labelStyle'=>$label_options,
  'draggable'=>true,
  // check the style ID 
  // afterwards!!!
  'labelClass'=>'labels',
  'labelAnchor'=>new EGMapPoint(22,2),
  'raiseOnDrag'=>true
);
 
$marker->setOptions($marker_options);
*/
 
// SECOND WAY:
/*
$marker->labelContent= '$Labled Marker';
$marker->labelStyle=$label_options;
$marker->draggable=true;
$marker->labelClass='labels';
$marker->raiseOnDrag= true;
 
$marker->setLabelAnchor(new EGMapPoint(22,0));
 
$marker->addHtmlInfoWindow($info_window_b);
 
$gMap->addMarker($marker);
*/ 
// enabling marker clusterer just for fun
// to view it zoom-out the map
$gMap->enableMarkerClusterer(new EGMapMarkerClusterer());
 
$gMap->renderMap();
?>
<style type="text/css">
.labels {
   color: red;
   background-color: white;
   font-family: "Lucida Grande", "Arial", sans-serif;
   font-size: 10px;
   font-weight: bold;
   text-align: center;
   width: 40px;     
   border: 2px solid black;
   white-space: nowrap;
}
</style>